
#include "../libpatches.h"
#include "cpsoct.h"
#include <math.h>

static void module_cpsoct_processor(module m);

void module_cpsoct_initializer(module m) {
	make_inputs(m, 2);
	make_outputs(m, 1);

	m->input_names[0] = "in";
	m->input_names[1] = "center";

	m->output_names[0] = "out";

	patch_one(m->inputs + 1);

	m->processor = module_cpsoct_processor;
}

static void module_cpsoct_processor(module m) {
	output o = m->outputs[0];
	input i = m->inputs[0];
	input c = m->inputs[1];

	*o = **c * pow(2, **i);
}

